<template>
	<view class="news-info">
		<view class="news-info-tit">{{newsInfo.name}}</view>
		<view class="news-info-time">
			<text>{{newsInfo.add_time}}</text>
			<text v-if="newsInfo.class_id==1">#资讯</text>
			<text v-if="newsInfo.class_id==2">#教程</text>
			<text v-if="newsInfo.class_id==3">#视频</text>
		</view>
		<view class="news-info-content">
			<jyf-parser :html="newsInfo.content" ref="article"></jyf-parser>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				newsInfo: {}
			};
		},
		onLoad(opstions) {
			this.$api.informationInfo({information_id: opstions.id}).then(res => {
				this.newsInfo = res.datas[0]
				uni.setNavigationBarTitle({
					title: res.datas[0].name
				})
			})
		}
	}
</script>

<style lang="scss">
	page{
		min-height: 100%;
		background-color: #FFF;
	}
	.news-info{
		padding: 30rpx;
		.news-info-tit{
			font-size: 32rpx;
			color: #666;
		}
		.news-info-time{
			margin: 10rpx 0;
			text{
				font-size: 24rpx;
				color: #999;
				margin-right: 20rpx;
			}
		}
		.news-info-content{
			font-size: 24rpx;
			line-height: 48rpx;
			color: #666;
		}
	}
</style>